package com.community.process._1010.dao.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.community.process._1010.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * 到餐加工主订单
 *
 * @author Zbs
 * @since 2024-09-05
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@TableName("yg_process_t_order")
@Schema(description = "到餐加工主订单")
public class ProcessTOrder extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "订单ID")
    private String tradeNo;

    @Schema(description = "主订单状态：1：未支付；2：已支付；3：买家关闭订单；4：超时未支付；5：商家关闭订单")
    private Integer mainStatus;

    @Schema(description = "订单状态：	    1-待确认/待支付，	    2-已支付，	    3-已发货，	    4-超时未支付，	    5-已收货，	    6-已完结/确认收货，	    7-申请退款中，	    8-发货前退款完结，	    9-发货后退款完结，	    10-收货后退款完结，	    11-退款完结，	    12-买家关闭订单，	    13-商家关闭订单")
    private Integer orderStatus;

    @Schema(description = "订单类型：1 自带食材单 2 成品菜订单 3 自组食材单")
    private Integer orderType;

    @Schema(description = "买家ID")
    private Long userId;

    @Schema(description = "商品名称")
    private String itemName;

    @Schema(description = "商品图片")
    private String itemImage;

    @Schema(description = "支付金额（单位：分）=商品价格+快递费-优惠券金额")
    private Long payAmount;

    @Schema(description = "实际支付金额（单位：分）=商品价格+快递费-优惠券金额")
    private Long actualPaymentAmount;

    @Schema(description = "快递费（单位：分）")
    private Long postAmount;

    @Schema(description = "优惠券金额（单位：分）")
    private Long couponAmount;

    @Schema(description = "优惠券ID")
    private String couponIds;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "就餐时间")
    private String dinnerTime;

    @Schema(description = "店铺名称")
    private String shopName;

    @Schema(description = "店铺地址")
    private String detailedAddress;

    @Schema(description = "店铺id")
    private Long shopId;

    @Schema(description = "联系人")
    private String contactPerson;

    @Schema(description = "地区ID")
    private Long areaId;

    @Schema(description = "地区名称")
    private String areaName;

    @Schema(description = "市ID")
    private Long cityId;

    @Schema(description = "市名称")
    private String cityName;

    @Schema(description = "省ID")
    private Long provinceId;

    @Schema(description = "省名称")
    private String provinceName;

    @Schema(description = "收货详细地址")
    private String addr;

    @Schema(description = "退款原因")
    private String refundReason;

    @Schema(description = "拒绝退款原因")
    private String reason;

    @Schema(description = "拓展字段，根据需求填写")
    private String expandInfo;

    public ProcessTOrder(Long id,String tradeNo, Long actualPaymentAmount, Long couponAmount) {
        super.setId(id);
        this.tradeNo = tradeNo;
        this.actualPaymentAmount = actualPaymentAmount;
        this.couponAmount = couponAmount;
        this.dinnerTime = dinnerTime;
        this.shopName = shopName;
        this.detailedAddress = detailedAddress;
        this.shopId = shopId;
    }
    public ProcessTOrder(Long id,String tradeNo) {
        this.setId(id);
        this.tradeNo = tradeNo;
    }


}
